//
//  DMRegisteredViewController.m
//  MCNKuaiYi
//
//  Created by 何典钊 on 2017/1/8.
//  Copyright © 2017年 Mr.Cannon. All rights reserved.
//

#import "DMRegisteredViewController.h"
#import "DMRegistered.h"
#import "DMSuperloginController.h"
@interface DMRegisteredViewController ()

@end

@implementation DMRegisteredViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"注册";
    self.view.backgroundColor = [UIColor whiteColor];
    [self setupUI];
    
    //设置跳转登录按钮
    UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithTitle:@"登录" style:UIBarButtonItemStyleDone target:self action:@selector(pushLogin)];
    self.navigationItem.rightBarButtonItem = barButton;
}
//跳转登录界面
- (void) pushLogin{
    DMSuperloginController *superLogin = [[DMSuperloginController alloc] init];
    [self.navigationController pushViewController:superLogin animated:YES];
}

- (void) setupUI {
    DMRegistered *regis = [[DMRegistered alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:regis];
  
    [regis setClickBlock:^(NSString *dmUserName, NSString *dmPassWord, NSString *dmVerification) {
        if (dmUserName.length != 11) {
             NSLog(@"失败");
        }
        if (![dmPassWord isEqualToString:@"123"]) {
             NSLog(@"密码错误");
        }
    }];
    
}

@end
